﻿using Microsoft.WowAddonStudio.FrameXml.Serialization;

using NUnit.Framework;

namespace Microsoft.WowAddonStudio.FrameXml.Components.Tests
{
    [TestFixture]
    public class ComponentFactoryTest : FrameXmlControlTestBase
    {
        [Test]
        public void CreateFontTest()
        {
            // Create a test font
            var testFont = new Font
            {
                Name = "TestFont",
                TrueTypeFont = @"Fonts\FRIZQT__.TTF",
                Color = new Color { Red = 1.0f, Green = 0.82f, Blue = 0f },
                FontHeight = new FontHeight
                {
                    Value = 12
                },
                Shadow = new Shadow
                {
                    Offset = new Dimension
                    {
                        AbsDimension = new AbsDimension
                        {
                            X = 1,
                            Y = -1
                        }
                    },
                    Color = new Color { Red = 0f, Green = 0f, Blue = 0f },
                }
            };

            var fontComponent = frameXmlComponentFactory.CreateComponent(testFont);

            Assert.IsNotNull(fontComponent);
        }

        [Test]
        public void CreateUiTest()
        {
            // Create empty Ui element
            var ui = new Ui();

            // Create control for Ui element
            var uiControl = frameXmlComponentFactory.CreateComponent<Ui, UiControl>(ui);

            Assert.IsNotNull(uiControl);
        }
    }
}
